package com.zlxtk.ling.nao;

import com.zlxtk.ling.po.Jue;
import com.zlxtk.ling.po.TingInputDataDto;
import com.zlxtk.ling.qiGuan.QiGuanType;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 处理听觉部分大脑
 * 单例
 */
public class TingNao extends Nao{
    //处理的器官类型
    private final QiGuanType qiGuanType = QiGuanType.TING;

    private static TingNao tingNao;

    public static TingNao getInstance() {
        if (tingNao == null) {
            tingNao = new TingNao();
            tingNao.init();
        }
        return tingNao;
    }

    private void init() {

    }

    @Override
    public QiGuanType getType() {
        return this.qiGuanType;
    }

    @Override
    public void handleData(List<Jue> jueList) throws Exception{
        for (Jue jue:jueList){
            if(jue.getData()!=null){
                int status=jue.getStatus();
                if(jue.getData().getClass().isAssignableFrom(TingInputDataDto.class)){
                    TingInputDataDto data= (TingInputDataDto) jue.getData();
                    String str=data.getData();
                    System.out.println("tingNao----"+str);
                }
            }
        }
    }
}
